#ifndef _MESHGEN_H
#define _MESHGEN_H


// Okay, time to spec the mesh.
// This is the compressed version - there will also be an editor-friendly format.

// F16     Overall scale factor, Float16
// B8      Number of rings
// B8      

struct Material {
	u8 texture_index;
	u8 shader_index;
};

// Scene storage
struct SuperMeshInstance {
	short x, y, z;
	float16 scale;
	u8 mesh;
	u8 parent;    // 0xFF = no parent
	u8 material;
};


// A super mesh is stored as one SuperMeshHeader, and then an arbitrary number of rings.
// It may be better for compression to store all the headers in sequence, I don't know.
// Let's see if it's good enough.
struct SuperMeshHeader {
	u8 ring_count;
};

enum RingFlags {
	RF_HARDEDGE = 1,
	RF_FIGURE8 = 2,
	RF_TAPER = 4,
};

// This is the AoS version, and only serves as documentation. In the compressed format, it's
// actually stored as SoA.
struct SuperMeshRing {
	u8 xscale;
	u8 yscale;
	u8 squareness;
	u8 flags;
};





#endif